﻿using System;
using System.Xml;

namespace HorrorsOfArkham.Game_Application_Layer
{
    public enum XMLType
    { 
        STRING
    }

    public class XMLResourceLoader
    {
        #region Members

        public static readonly XMLResourceLoader Instance = new XMLResourceLoader();

        #endregion

        #region Initialization

        protected XMLResourceLoader()
        { 
        }

        #endregion

        #region Loading

        /// <summary>
        /// Method for loading and XML file
        /// </summary>
        /// <param name="path">Path of the file</param>
        /// <param name="xmlTypeID">Type of XML, 
        ///                         1 = string XML</param>
        public bool LoadXMLFromFile(string path, XMLType xmlType)
        {
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load(@path);

            bool parsingDone = false;

            switch (xmlType)
            {
                case XMLType.STRING:
                    {
                        parsingDone = XMLResourceParser.Instance.ParseStringXML(xmlDoc);
                        break;
                    }
            }

            return parsingDone;
        }

        #endregion

    }
}
